/**
 * 
 */
package com.xbjtech.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.xbjtech.model.Region;
import com.xbjtech.service.RegionService;

/**
 * @author Administrator
 *
 */
@Controller
@RequestMapping("/region")
public class RegionController {
	
	@Autowired
	RegionService regionService;
		
	@GetMapping("/getregions")
	@ResponseBody
	public List<Region> list(Long parId) {
		// 查省  parId = 0
		List<Region> regionsByParId = regionService.getRegionsByParId(parId);
		return regionsByParId;
	}

}
